package cn.zj.springtest;

import cn.zj.springtest.entity.Person;
import cn.zj.springtest.factorybean.MyFactoryBean;
import cn.zj.springtest.factorybean.entity.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringTest {
	public static void main(String[] args) {
//		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application-${username}.xml");
//		Person pserson = context.getBean("person", Person.class);
//		System.out.println(pserson);
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("factorybeantest.xml");
		MyFactoryBean myFactoryBean = context.getBean("&myFactoryBean", MyFactoryBean.class);
		User user = context.getBean("myFactoryBean", User.class);
		System.out.println(user);
		System.out.println(myFactoryBean);
	}
}
